


<div class="caption">
    <table class="table table_detail">
        <tr>
            <td class="td_left">标题</td>
            <td>
                <input type="text" value="{$detail.name}" name="name" id="name" autocomplete="off"/>
                <span class="tip">本站已有的素材，不能审核通过</span>  
            </td>
        </tr>
        <tr>
            <td class="td_left">描述</td>
            <td>
                <textarea class="textarea" name="description" id="description" autocomplete="off">{$detail.description}</textarea>
            </td>
        </tr>
        <tr>
            <td class="td_left">关键字</td>
            <td> 
                <input  type="text" class="common_txt keywords" name="keywords[]" autocomplete="off" value="{$keywords[0]}" style="width:150px"/>
                <input  type="text" class="common_txt keywords" name="keywords[]" autocomplete="off" value="{$keywords[1]}" style="width:150px"/>
                <input  type="text" class="common_txt keywords" name="keywords[]" autocomplete="off" value="{$keywords[2]}" style="width:150px"/>
                <input  type="text" class="common_txt keywords" name="keywords[]" autocomplete="off" value="{$keywords[3]}" style="width:150px"/>
            </td>
        </tr>
        <tr>
            <td class="td_left">分类</td>
            <td>
                <div class="cats">
                    <if condition="$detail['cat_id'] eq 15 && $detail['original_id'] gt 0">
                        <input type='hidden' name='cat_id' id="cat_id" value='15'/>
                        <else/>
                        <select id="cat_id" name="cat_id" autocomplete="off" onchange="changeCats(this.value, '{$table}')" style="width:150px;">
                            <option value="">请选择分类</option>
                            <foreach name="cats" item="row">
                                <option value="{$row.id}" {$row.id|getEqual=###,$detail['cat_id'],'selected'}>{$row.name}</option>
                            </foreach>
                        </select>
                    </if>
                    <select id="cat_sub_id" name="cat_sub_id" data_cat_sub_id="{$detail['cat_sub_id']}" autocomplete="off" style="width:150px">
                        <option value="">请选择子分类</option>
                        <foreach name="cats_sub" item="row">
                            <option value="{$row.id}" {$row.id|getEqual=###,$detail['cat_sub_id'],'selected'}>{$row.name}</option>
                        </foreach>
                    </select>
                </div>
            </td>
        </tr>
        <tr>
            <td class="td_left">上传封面图</td>
            <td>
                <a id="big_img_area">
                    <if condition="$detail.logo_big neq ''">
                        <a class="fancybox_img" title="{$row.title}" href="__APP__/{$detail.logo_big}"><img src="__APP__/{$detail.logo_big}" style="max-height:300px" alt="封面图" class="cover_img" id="cover_img"/></a>
                        <else/>
                        <img src="__PUBLIC__/images/cover.jpg" alt="封面图" class="cover_img" id="cover_img"/>
                    </if>
                    <input name="logo_big" value="{$detail.logo_big}" type="hidden" autocomplete="off"/>
                </a>
                <a class="cover_btn" id="cover_btn_big"><span>+</span></a>
                <span class="tip">建议760*980px像素的图片。宽高范围：500px<=宽度<=1000px，高度<=1500px</span>  
            </td>
        </tr>

        <tr>
            <td class="td_left">上传源文件</td>
            <td>
                <a id="zips_area">
                    <input id="zip_input"  value='{$detail.zip}' type="text" style="background:#ddd;width:350px;margin:20px 16px 0 0" disabled="disabled" autocomplete="off"/>
                </a>
                <a class="cover_btn" id="zip_btn"><span>+</span></a>
                <span class="tip">根目录必须含有“index.html”否则无法演示不能通过审核。</span>  
                <input type="hidden" name="zip" id="zip" autocomplete="off" value='{$detail.zip}'/>
                <a href="__APP__/{$detail.zip}">点击下载</a>
            </td>
        </tr>

        <include file="Uploads:original" />
        <if condition="$detail.mtype eq 1">
            <tr>
                <td class="td_left">颜色</td>
                <td>
            <foreach name="modal_colors" item="row">
                <label class='label_width'>
                    <input type='checkbox' value='{$row.id}' name='color_id[]' {$detail.color_id|getChecked=###,$row['id']} autocomplete="off">
                    {$row.name}
                </label>
            </foreach>
            </td>
            </tr>
            <tr>
                <td class="td_left">布局</td>
                <td>
            <foreach name="modal_lays" item="row">
                <label class='label_width'>
                    <input type='radio' value='{$row.id}' name='lay_id' {$detail.lay_id|getEqual=###,$row['id'],'checked'} autocomplete="off">
                    {$row.name}
                </label>
            </foreach>
            </td>
            </tr>
            <else/>
            <tr>
                <td class="td_left">难易级别</td>
                <td>
            <foreach name="js_easy" item="row">
                <label style="width:70px">
                    <input class="ace" type="radio" name="easy_id" value='{$row.id}' {$detail.easy_id|getEqual=###,$row['id'],'checked'} autocomplete='off'/>
                    <span class="lbl"> {$row.name}</span>
                </label>

            </foreach>
            </td>
            </tr>
        </if>
        <tr>
            <td class="td_left">来源</td>
            <td>
                <input type="text" value="{$detail.source}" placeholder="http://www.sucaihuo.com" name="source" autocomplete="off"/>
                <span class="tip">链接地址如：“http://www.sucaihuo.com”</span>  
            </td>
        </tr>

    </table>
</div>
<div class="course">
    <if condition="$detail.mtype eq 2 or $detail.mtype eq 20"><h2><strong class="normal">教程</strong></h2></if>
    <table class="table table_detail" id="table_course">
        <if condition="$detail.mtype eq 2 or $detail.mtype eq 20">
            <tr>
                <td class="td_left"></td>
                <td>
                    <ul id="module_list">
                        <foreach name="jsons" item="row">
                            <li>
                                <div class="item_top clearfix">
                                    <div class="item_ico">{$key+1}</div>
                                    <div class="item_content"><textarea name="contents[]" autocomplete="off" onkeyup="checkCourseContent($(this))">{$row.content}</textarea></div>
                                    <div class="item_nav">
                                        <a class="move-btn bg"></a>
                                        <a class="delete-btn bg"></a>
                                        <a class="add-btn bg"></a>
                                        <a class="plupload_btn"></a>
                                        <ul class="js-upload-image-list upload-image-list clearfix" onclick="addWebuploadCurrent($(this))">
                                            <li class="fileinput-button js-add-image webuploader-container" data-type="loading">
                                                <div class="webuploader-pick">
                                                    <a class="fileinput-button-icon" href="javascript:;"></a>
                                                </div>
                                            </li>
                                        </ul>
                                        <div  class="cats_type clearfix">
                                            <a class="chose_type">{$row.type|getUploadsCatsType}</a>
                                            <a class="sub"  data-type=0>段落</a>
                                            <a class="sub"  data-type=4>标题</a>
                                            <a class="sub"  data-type=1>html</a>
                                            <a class="sub"  data-type=2>js</a>
                                            <a class="sub"  data-type=3>css</a>
                                            <a class="sub"  data-type=6>PHP</a>
                                            <span class="arrow arrow-up"></span> 
                                            <input type="hidden" name="types[]" value="{$row.type}" autocomplete="off"/>
                                        </div>
                                    </div>
                                </div>
                                <ul class="course_imgs clearfix">
                                    <foreach name="row['pics']" item='row2'>
                                        <li class="thumb">
                                            <img src="__APP__/{$row2}" data-pic="{$row2}"/>
                                            <a class="media-rm-btn hide"></a>
                                        </li>
                                    </foreach>
                                </ul>
                            </li>
                        </foreach>
                    </ul>

                </td>
            </tr>
        </if>
         <tr>
            <td class="td_left">状态</td>
            <td>

                <label>
                    <input class="ace" type="radio"  name="is_check" value='0' {$detail.is_check|getEqual=###,0,'checked'} autocomplete='off'/>
                    <span class="lbl"> 关闭</span>
                </label>
                <label>
                    <input class="ace" type="radio"  name="is_check" value='1' {$detail.is_check|getEqual=###,1,'checked'} autocomplete='off'/>
                    <span class="lbl"> 开启</span>
                </label>
            </td>
        </tr>
        <tr>
            <td class="td_left">是否推荐</td>
            <td>

                <label>
                    <input class="ace" type="radio"  name="is_recommend" value='0' {$detail.is_recommend|getEqual=###,0,'checked'} autocomplete='off'/>
                    <span class="lbl"> 否</span>
                </label>
                <label>
                    <input class="ace" type="radio"  name="is_recommend" value='1' {$detail.is_recommend|getEqual=###,1,'checked'} autocomplete='off'/>
                    <span class="lbl"> 是</span>
                </label>
            </td>
        </tr> 
        <tr>
            <td class="td_left">是否演示</td>
            <td>

                <label>
                    <input class="ace" type="radio"  name="ord" value='-1' {$detail.ord|getEqual=###,-1,'checked'} autocomplete='off'/>
                    <span class="lbl"> 否</span>
                </label>
                <label>
                    <input class="ace" type="radio"  name="ord" value='0' {$detail.ord|getEqual=###,0,'checked'} autocomplete='off'/>
                    <span class="lbl"> 是</span>
                </label>
            </td>
        </tr>
        <tr>
            <td class="td_left">标签:</td>
            <td> 
        <foreach name="tags" item="row">
            <input  type="text" class="common_txt tags" autocomplete="off" value="{$row.name}" style="width:120px"/>
        </foreach>
        <input  type="text" class="common_txt tags" autocomplete="off" value="" style="width:120px"/>
        <input  type="text" class="common_txt tags" autocomplete="off" value="" style="width:120px"/>
        <input  type="text" class="common_txt tags" autocomplete="off" value="" style="width:120px"/>
        <input  type="text" class="common_txt tags" autocomplete="off" value="" style="width:120px"/>
        </td>
        </tr>
        <tr>
            <td class="td_left">状态</td>
            <td>
                <label>
                    <input class="ace" type="radio"  name="state" value='-1' {$detail.state|getEqual=###,-1,'checked'} autocomplete='off'/>
                    <span class="lbl"> 拒绝</span>
                </label>
                <label>
                    <input class="ace" type="radio"  name="state" value='0' {$detail.state|getEqual=###,0,'checked'} autocomplete='off'/>
                    <span class="lbl"> 待审核</span>
                </label>
                <label>
                    <input class="ace" type="radio"  name="state" value='2' {$detail.state|getEqual=###,2,'checked'} autocomplete='off'/>
                    <span class="lbl"> 推送</span>
                </label>
            </td>
        </tr>
        
        <tr>
            <td class="td_left">原因</td>
            <td>
                <textarea class="textarea" name="reason" id="reason" autocomplete="off">{$detail.reason}</textarea>
            </td>
        </tr>
        <tr>
            <td class="td_left"></td>
            <td>
                <input type='hidden' name='id' value='{$id}' />
                <button class="btn btn-info btn-sm" type="button" onclick="push_temp('{$mtype}')">
                    <i class="icon-ok bigger-110 "></i>
                    保 存
                </button>
                <button class="btn btn-xs ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false" data-dismiss="modal">
                    <span class="ui-button-text">
                        <i class="icon-remove bigger-110"></i>
                        取 消
                    </span>
                </button>
                <div id="huo_url">
                    <if condition="$huo_id gt 0"> 
                        <p>前台详情：<a href="{$url_detail}" target="_blank">{$url_detail}</a></p>
                        <p>前台demo：<a href="{$url_demo}" target="_blank">{$url_demo}</a></p>
                        <p>后台详情：<a href="{$url_admin_detail}" target="_blank">{$url_admin_detail}</a></p>
                    </if>
                </div>
            </td>
        </tr>
    </table>
</div>



<include file="Uploads:plupload" />

<link rel="stylesheet" href="__PUBLIC__/css/uploads.css" type="text/css" /> 

<script type="text/javascript" src="__PUBLIC__/js/plugins/jquery.dragsort-0.5.2.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/plugins/textarea_autoheight.js"></script>
<script type="text/javascript" src="__APP__/other/js/uploads.js"></script>
<script type="text/javascript">
  function push_temp(mtype) {
        var id = $("input[name=id]").val();
        var name = $("#name").val();
        var cat_sub_id = $("#cat_sub_id").val();
        var cat_id = $("#cat_id").val();
        var color_ids = "";
        $(".modal_color_id:checked").each(function() {
            color_ids += $(this).val() + ",";
        })
        var lay_id = $("input[name=modal_lay_id]:checked").val();
        var lang_id = $("input[name=modal_lang_id]:checked").val();
        var easy_id = $("input[name=easy_id]:checked").val();
        var logo = $("input[name=logo]").val();
        var logo_big = $("input[name=logo_big]").val();
         var ord = $("input[name=ord]").val();
        
        var keywords = "";
        $(".keywords").each(function() {
            if ($(this).val() != '') {
                keywords += $(this).val() + ",";
            }
        })
        var description = $("#description").val();
        var is_recommend = $("input[name=is_recommend]:checked").val();
        var is_check = $("input[name=is_check]:checked").val();
        var is_original = $("input[name=is_original]:checked").val();
        var zip = $("#zip").val();
        var points = $("#points").val();
        var tags = "";
        $(".tags").each(function() {
            if ($(this).val() != '') {
                tags += $(this).val() + ",";
            }
        })
           var state = $("input[name=state]:checked").val();
               var points_type = $("input[name=points_type]:checked").val();
           
        $.post("{:U('Box/temp_save')}", {id: id, name: name, cat_id: cat_id, cat_sub_id: cat_sub_id, color_ids: color_ids, lay_id: lay_id, lang_id: lang_id, easy_id: easy_id,
            logo_big: logo_big, logo: logo, mtype: mtype, keywords: keywords, description: description, is_recommend: is_recommend, is_check: is_check, is_original: is_original, zip: zip, tags: tags,
            points: points,ord:ord,state:state,points_type:points_type}, function(data) {

            if (data.code > 0) {
                alert("传输成功");
                $("#huo_url").html("<p>前台详情：<a href='" + data.url_detail + "' target='_blank'>" + data.url_detail + "</a></p>\n\
        <p>前台DEMO：<a href='" + data.url_demo + "' target='_blank'>" + data.url_demo + "</a></p>\n\
<p>后台详情：<a href='" + data.url_admin_detail + "' target='_blank'>" + data.url_admin_detail + "</a></p>");
            } else {
                alert(data.error);
            }
        }, "json")
    }
</script>